\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}
\section{Lattice Boltzmann Method Implementation}

A C++ code package was developed to carry out LBM simulations in two dimensional and three dimensional. A MRT scheme was used in the collision step to improve the numerical stability and eliminate the viscosity dependence of permeability calculation. Two separated versions of the code have been developed to simulate single phase and binary fluids system respectively.Several subroutines are developed to compute the permeability, export simulation results in VTK format for 3D visualisation ,mesh refiner and Reynolds number calculation. The capability of this code package for single phase flow simulations (2D and 3D) can be summarised as:

\begin{itemize}
\item Simulate high Reynolds number flow (Re $<$ 2000, Karman Street Simulation)
\item Simulate low Reynolds number flow with complex geometry
\item Calculate Permeability of porous medias
\item Refine the mesh 
\end{itemize}




In order to simulate the flow of binary fluids system and interface behaviours and wetting, three multi-component LBM models including the Shan-Chen pseudo potential model, the Color Gradient Model, the Free Energy Model were studied and implemented. Their performances were compared with theoretical predictions by numerical experiments.The multi-component LBM code package is able to simulate:

\begin{itemize}
 \item Interface evolution with surface tension and wetability 
 \item Binary fluids with different viscosity
 \item Binary fluids system with complex geometry
 \item Snap off phenomena
 \item Capillary raising
 \item Capillary wave
 \item Capillary fingering 
\end{itemize}



\subsection{Parallel LBM implementation}
The LBM simulator is able to simulate various complex flow with extremely complicated boundaries. However, it is very time-consuming even with modern computers. 
%Recent development of computer-aided imaging enable us to obtain high resolution 3D models of rocks. The porosity of these voxel models are normally less than $40\%$, 


In a single phase flow simulation, most of the computation is local. In collision step, the distribution of fluids particles will be changed and no information of neighbouring points is needed. So does macroscopic quantities calculations. Communication between points is only needed in streaming step at which the updated distribution functions will stream to the adjacent mesh points. The direction of streaming is determined by the velocity of the particles on the mesh points.Since the parallel computing has been available for decades of years, it should be the solution of improving the efficiency of LBM code.\\

Several studies has been carried out to investigate the efficiency of the parallel lattice Boltzmann method. Skordos (1995) compared two parallel CFD methods, finite differential method and lattice Boltzmann method. A equal partition strategy was used in this study. He investigated the relationship between problem sizes, size of each partition, number of partitions and the performance of the code. A $50\%$ of efficiency is obtained if the number of processor is more than 15. Martys et al. (1999) implemented a parallel multi-phase lattice Boltzmann code to simulate multiphase flows. A speedup slightly lower than linear was achieved. \\

In this work, a Message Passing Interface (MPI) library was used to carry out the communications between partitions.The computational domain is divided equally into several partitions in x direction. This is showed in Figure (\ref{partition1}).Particles from different partitions are illustrated with different colours. The particles in the doted line area will stream to the adjacent nodes and therefore need communicate with particles that stored in another processor. A MPI subroutine is developed to exchange distribution function values for particles in this area.     

\begin{figure}[!htbp]
\begin{center}
\includegraphics[width=3in]{partition.eps}
\end{center}
\caption{Schematic diagram of partition geometry}\label{partition1}
\end{figure}

\end{document}
